import type { RouteRecordRaw } from "vue-router";
import latoutVue from "@/components/global/latout.vue";
import contentsVue from "@/views/contents.vue";
import problemsVue from "@/views/problems.vue";
import home from "@/views/home.vue";
import about from "@/views/about.vue";
import register from "@/components/user/register.vue";
import admin from "@/views/adminView/admin.vue";
export const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "latout",
    component: latoutVue,
    meta: {
      // hideInMenu: true,
      info: false,
    },
    children: [
      {
        path: "home",
        name: "Home",
        component: home,
        meta: {
          // access: "admin",
          info: false,
        },
      },

      {
        path: "problemsVue",
        name: "problemsVue",
        component: problemsVue,
        meta: {
          access: "user",
          info: false,
        },
      },
      {
        path: "contentsVue",
        name: "contents",
        component: contentsVue,
        meta: {
          access: "user",
          info: false,
        },
      },
      {
        path: "about",
        name: "about",
        component: about,
        meta: {
          info: false,
        },
      },
      {
        path: "problemInfo",
        name: "problemInfo",
        component: () => import("@/views/problems/problemInfo.vue"),
        meta: {
          hideInMenu: true, //菜单子项隐藏
          info: false,
        },
      },
      {
        path: "contentInfo",
        name: "contentInfo",
        component: () => import("@/views/content/contentInfo.vue"),
        meta: {
          hideInMenu: true, //菜单子项隐藏
          info: false,
        },
      },
      {
        path: "userIndex",
        name: "userInfo",
        component: () => import("@/views/userView/userInfoView.vue"),
        meta: {
          info: true,
        },
      },
      {
        path: "userSetting",
        name: "userSetting",
        component: () => import("@/views/userView/userSetting.vue"),
        meta: {
          info: true,
        },
        children: [
          {
            path: "commonSetting",
            name: "userSettingPersonal",
            component: () => import("@/views/userView/userSettingPersonal.vue"),
            meta: {
              key: 1,
            },
          },
          {
            path: "equipmentSetting",
            name: "equipmentSetting",
            component: () => import("@/views/userView/equiptmentSetting.vue"),
            meta: {
              key: 2,
            },
          },
          {
            path: "accountSetting",
            name: "accountSetting",
            component: () => import("@/views/userView/accountSetting.vue"),
            meta: {
              key: 3,
            },
          },
        ],
      },
    ],
  },
  {
    path: "/admin",
    name: "admin",
    component: admin,
    meta: {
      // hideInMenu: true,
      info: true,
    },
    children: [
      {
        path: "/admin/A",
        name: "A",
        component: () => import("@/views/adminView/A.vue"),
        meta: {
          hideInMenu: true, //菜单子项隐藏
          info: false,
        },
      },
      {
        path: "/admin/B",
        name: "B",
        component: () => import("@/views/adminView/B.vue"),
        meta: {
          hideInMenu: true, //菜单子项隐藏
          info: false,
        },
      },
      {
        path: "/admin/C",
        name: "C",
        component: () => import("@/views/adminView/C.vue"),
        meta: {
          hideInMenu: true, //菜单子项隐藏
          info: false,
        },
      },
    ],
  },
];
